package com.ruoyi.bnt.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bnt.mapper.BntSundayworshipMapper;
import com.ruoyi.bnt.domain.BntSundayworship;
import com.ruoyi.bnt.service.IBntSundayworshipService;
import com.ruoyi.common.core.text.Convert;

/**
 * 主日敬拜Service业务层处理
 * 
 * @author yyj
 * @date 2020-09-21
 */
@Service
public class BntSundayworshipServiceImpl implements IBntSundayworshipService 
{
    @Autowired
    private BntSundayworshipMapper bntSundayworshipMapper;

    /**
     * 查询主日敬拜
     * 
     * @param id 主日敬拜ID
     * @return 主日敬拜
     */
    @Override
    public BntSundayworship selectBntSundayworshipById(String id)
    {
        return bntSundayworshipMapper.selectBntSundayworshipById(id);
    }

    /**
     * 查询主日敬拜列表
     * 
     * @param bntSundayworship 主日敬拜
     * @return 主日敬拜
     */
    @Override
    public List<BntSundayworship> selectBntSundayworshipList(BntSundayworship bntSundayworship)
    {
        return bntSundayworshipMapper.selectBntSundayworshipList(bntSundayworship);
    }

    /**
     * 新增主日敬拜
     * 
     * @param bntSundayworship 主日敬拜
     * @return 结果
     */
    @Override
    public int insertBntSundayworship(BntSundayworship bntSundayworship)
    {
        bntSundayworship.setCreateTime(DateUtils.getNowDate());
        return bntSundayworshipMapper.insertBntSundayworship(bntSundayworship);
    }

    /**
     * 修改主日敬拜
     * 
     * @param bntSundayworship 主日敬拜
     * @return 结果
     */
    @Override
    public int updateBntSundayworship(BntSundayworship bntSundayworship)
    {
        bntSundayworship.setUpdateTime(DateUtils.getNowDate());
        return bntSundayworshipMapper.updateBntSundayworship(bntSundayworship);
    }

    /**
     * 删除主日敬拜对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBntSundayworshipByIds(String ids)
    {
        return bntSundayworshipMapper.deleteBntSundayworshipByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除主日敬拜信息
     * 
     * @param id 主日敬拜ID
     * @return 结果
     */
    @Override
    public int deleteBntSundayworshipById(String id)
    {
        return bntSundayworshipMapper.deleteBntSundayworshipById(id);
    }

    @Override
    public int addVisitNum(String id) {
        return bntSundayworshipMapper.addVisitNum(id);
    }
}
